/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Cícero
 */
@Entity
@Table(name = "cadastrofuncao", catalog = "bancosysepi", schema = "")
@NamedQueries({
    @NamedQuery(name = "Cadastrofuncao.findAll", query = "SELECT c FROM Cadastrofuncao c"),
    @NamedQuery(name = "Cadastrofuncao.findByIdFuncao", query = "SELECT c FROM Cadastrofuncao c WHERE c.idFuncao = :idFuncao"),
    @NamedQuery(name = "Cadastrofuncao.findByNomeFuncao", query = "SELECT c FROM Cadastrofuncao c WHERE c.nomeFuncao = :nomeFuncao"),
    @NamedQuery(name = "Cadastrofuncao.findByDescricaoFuncao", query = "SELECT c FROM Cadastrofuncao c WHERE c.descricaoFuncao = :descricaoFuncao"),
    @NamedQuery(name = "Cadastrofuncao.findByNivelRisco", query = "SELECT c FROM Cadastrofuncao c WHERE c.nivelRisco = :nivelRisco")})
public class Cadastrofuncao implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_funcao")
    private Integer idFuncao;
    @Column(name = "nome_funcao")
    private String nomeFuncao;
    @Column(name = "descricao_funcao")
    private String descricaoFuncao;
    @Column(name = "nivel_risco")
    private String nivelRisco;

    public Cadastrofuncao() {
    }

    public Cadastrofuncao(Integer idFuncao) {
        this.idFuncao = idFuncao;
    }

    public Integer getIdFuncao() {
        return idFuncao;
    }

    public void setIdFuncao(Integer idFuncao) {
        Integer oldIdFuncao = this.idFuncao;
        this.idFuncao = idFuncao;
        changeSupport.firePropertyChange("idFuncao", oldIdFuncao, idFuncao);
    }

    public String getNomeFuncao() {
        return nomeFuncao;
    }

    public void setNomeFuncao(String nomeFuncao) {
        String oldNomeFuncao = this.nomeFuncao;
        this.nomeFuncao = nomeFuncao;
        changeSupport.firePropertyChange("nomeFuncao", oldNomeFuncao, nomeFuncao);
    }

    public String getDescricaoFuncao() {
        return descricaoFuncao;
    }

    public void setDescricaoFuncao(String descricaoFuncao) {
        String oldDescricaoFuncao = this.descricaoFuncao;
        this.descricaoFuncao = descricaoFuncao;
        changeSupport.firePropertyChange("descricaoFuncao", oldDescricaoFuncao, descricaoFuncao);
    }

    public String getNivelRisco() {
        return nivelRisco;
    }

    public void setNivelRisco(String nivelRisco) {
        String oldNivelRisco = this.nivelRisco;
        this.nivelRisco = nivelRisco;
        changeSupport.firePropertyChange("nivelRisco", oldNivelRisco, nivelRisco);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFuncao != null ? idFuncao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cadastrofuncao)) {
            return false;
        }
        Cadastrofuncao other = (Cadastrofuncao) object;
        if ((this.idFuncao == null && other.idFuncao != null) || (this.idFuncao != null && !this.idFuncao.equals(other.idFuncao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.view.Cadastrofuncao[ idFuncao=" + idFuncao + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
